home *** CD-ROM | disk | FTP | other *** search
/ Plug-In Power Pack for Netscape Communicator / Plug-In Power Pack for Netscape Communicator.iso / plugins / dataviews / dvdraw / examples / datasource / exampledsdll.h < prev    next >
C/C++ Source or Header  |  1997-05-12  |  3KB  |  86 lines

  1. /////////////////////////////////////////////////////////////////////////////
  2. //
  3. // ExampleDsDll.h : DataViews Data Source DLL interface header file
  4. //
  5. /////////////////////////////////////////////////////////////////////////////
  6.  
  7. #ifndef EXAMPLEDSDLL_H
  8. #define EXAMPLEDSDLL_H
  9.  
  10. #include "DvDsDll.h"
  11.  
  12.  
  13. /////////////////////////////////////////////////////////////////////////////
  14. //
  15. // VARDEFDATA--
  16. //        Data structure that is used to store the various variable
  17. //        definitions that get read in...
  18. //
  19. typedef struct tagVARDEFDATA {
  20.     ADDRESS    m_pBuffer;        //  Static buffer we rebind to...
  21.     CString    m_csVarName;    //  Variable name
  22.     CString m_csVarTypeName;//  Variable type, i.e. V_F_TYPE = "FLOAT"
  23.     int        m_nVarType;        //  Variable type, i.e. V_F_TYPE
  24.     int        m_nRows;        //  Rows & Cols represent the variable's
  25.     int        m_nCols;        //     shape. i.e. scaler, vector, matrix
  26.     double  m_dLowRange;    //  Low range
  27.     double  m_dHighRange;    //  High range
  28.  
  29.     tagVARDEFDATA* next;    // Link to next in list...
  30.  
  31. } VARDEFDATA;
  32.  
  33.  
  34. /////////////////////////////////////////////////////////////////////////////
  35. //
  36. // DATABUFENTRY--
  37. //
  38. typedef struct tagDATABUFENTRY {
  39.     char*    name;   //  String value
  40.     int      type;   //  Constant value
  41.     char*    name2;  //  A more useful, readable name
  42.     ADDRESS  addr;   //  Base address
  43. } DATABUFENTRY;
  44.  
  45.  
  46. /////////////////////////////////////////////////////////////////////////////
  47. // class CExampleDsDll
  48.  
  49.  
  50. class CExampleDsDll : public CDvDsDll
  51. {
  52. public :
  53.     CExampleDsDll();
  54.     ~CExampleDsDll() {}
  55.  
  56. private :
  57.     enum { NUM_DATA_TYPES = 11 };
  58.  
  59.     static DATABUFENTRY m_TypeTable[NUM_DATA_TYPES];
  60.  
  61.     VARDEFDATA*        m_pVarDefList;
  62.  
  63.     // Useful variable definitions to keep handy...
  64.     VARDEFDATA*        m_pDefVar;      // First one in list
  65.     VARDEFDATA*        m_pDefTextVar;  // For input objects needing text
  66.  
  67. private :
  68.     void    SetVarTagName(VARDEFDATA* pData, const char* varName);
  69.     void    GetVarTagName(DV_DSDLLDATA* pData);
  70.     void    ReadVarDefinitions();
  71.     int        GetNextWord(char** start, char** end,  BOOL term);
  72.     BOOL    OpenDataFile(CStdioFile& cFile);
  73.     char*   LookupDataType(char* string, int* type);
  74.     ADDRESS LookupBaseAddr(int data_type);
  75.     void    AlignVdpToVarDefinition(VARDESC vdp, VARDEFDATA* pVarData);
  76.     void    AttachVdpToDefTextVar(DV_DSDLLDATA* pData);
  77.     void    AttachVdpToDefVar(DV_DSDLLDATA* pData);
  78.  
  79. public :
  80.             void    Release() { delete this; }
  81.     virtual int        HandleRequest(DV_DSDLLDATA* pData, CWnd* pParent);
  82.     virtual void    GetIdInfo(CString& mfgName, CString& objName, CString& versionStr);
  83. };
  84.  
  85.  
  86. #endif // EXAMPLEDSDLL_H